<template>
  <div class="coupon_list" v-for="(item, key) in list" :key="key">

    <div class="coupon_item">
        <div class="item_content">
            <router-link to="/coupon/info">
                <div class="left">{{ item.rate * 100 }}<span>折</span></div>
                <div class="right">
                    <div>新店优惠券</div>
                    <div>订单满<span>100元</span>打<span>8折</span></div>
                    <div>每人限领1张</div>
                    <div>领取后10天内有效</div>
                </div>
            </router-link>
        </div>
        <div class="item_btn">
            <a class="right_btn">优惠详情</a>
        </div>
    </div>

  </div>

  <Tabbar />
</template>

<script setup>
  const {proxy} = getCurrentInstance()
  let business = proxy.$business.value

  let list = ref([])

  onMounted(() => {
    Coupon()

  })

  const Coupon = async () =>
  {

    var params = {
      busid: business.id
    }
    
    var result = await proxy.$POST({
      url: 'Business/coupon',
      params
    })

    list.value = result.data.list
  }
</script>

<style scoped>
  @import url('/assets/css/CouponIndex.css');
</style>